package ${basePackage}.dao.system.model;

import ${basePackage}.core.constants.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统接口配置
 * @author Eva.Caesar Liu
 * @since 2023/08/23 16:01
 */
@Data
@ApiModel("系统接口配置")
@TableName("`SYSTEM_INTERFACE_CONFIG`")
public class SystemInterfaceConfig implements Serializable {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
    @NotNull(message = "主键不能为空", groups = {Constants.OperaType.Update.class, Constants.OperaType.UpdateStatus.class})
    private Integer id;

    @ApiModelProperty(value = "接口名称")
    @NotBlank(message = "接口名称不能为空", groups = {Constants.OperaType.Create.class, Constants.OperaType.Update.class})
    private String name;

    @ApiModelProperty(value = "接口路径正则")
    @NotBlank(message = "接口路径正则不能为空", groups = {Constants.OperaType.Create.class, Constants.OperaType.Update.class})
    private String uriPattern;

    @ApiModelProperty(value = "启用2FA认证")
    @NotNull(message = "启用2FA认证不能为空", groups = {Constants.OperaType.Create.class, Constants.OperaType.Update.class})
    private Boolean enableTwoFa;

    @ApiModelProperty(value = "启用加密")
    @NotNull(message = "启用加密不能为空", groups = {Constants.OperaType.Create.class, Constants.OperaType.Update.class})
    private Boolean enableEncrypt;

    @ApiModelProperty(value = "权重")
    @NotNull(message = "权重不能为空", groups = {Constants.OperaType.Create.class, Constants.OperaType.Update.class})
    private Integer weight;

    @ApiModelProperty(value = "是否禁用")
    @NotNull(message = "是否禁用不能为空", groups = {Constants.OperaType.UpdateStatus.class})
    private Boolean disabled;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建人", example = "1")
    private Integer createUser;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "更新人", example = "1")
    private Integer updateUser;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    @ApiModelProperty(value = "是否已删除")
    private Boolean deleted;

}
